﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel;
using System.ServiceModel.Channels;

using DragDraw.UserService;

namespace DragDraw.Util
{
    public class UserServiceBasicClient
    {
        public static readonly string SERVICE_ADDRESS = "http://localhost/UserService.svc";
        private static UserServiceBasicClient m_instance;
        static UserServiceBasicClient()
        {
            m_instance = new UserServiceBasicClient();
        }
        public static UserServiceBasicClient Instance
        {
            get { return m_instance; }
        }

        private UserServiceClient m_client;

        private UserServiceBasicClient()
        {
            Ready = false;

            Binding binding = new BasicHttpBinding();
            EndpointAddress endPoint = new EndpointAddress(
                    SERVICE_ADDRESS);
            
            m_client = new UserServiceClient(/*binding, endPoint*/);

            Ready = true;
        }

        public UserServiceClient Client
        {
            get { return m_client; }
        }

        public bool Ready { get; set; }
    }
}
